<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>配置信息 Config Form</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" th:href="@{/statics/layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{/statics/style/admin.css}" media="all">
    <style type="text/css">
        .field-col-md3{float: left;width: 33%}
        .field-col-md9{float: left;width: 67%}
        .sub-menu-space{margin-left: 15px}
    </style>
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-config" id="layuiadmin-form-config" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入配置名称"
                   class="layui-input" th:value="${config.title}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">代码</label>
        <div class="layui-input-block">
            <input type="text" name="code" lay-verify="required" autocomplete="off" placeholder="请输入代码"
                   class="layui-input" th:value="${config.code}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">数值</label>
        <div class="layui-input-block">
            <input type="text" name="value" lay-verify="required" autocomplete="off" placeholder="请输入数值"
                   class="layui-input" th:value="${config.value}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-block">
            <select name="type">
                <option value="1" th:selected="${config.type == 1 ? 'true':'false'}">单选开关</option>
                <option value="2" th:selected="${config.type == 2 ? 'true':'false'}">输入框</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" name="sorting" lay-verify="required" autocomplete="off" placeholder="请输入排序"
                   class="layui-input" th:value="${config.sorting}">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">具体描述</label>
        <div class="layui-input-block">
            <textarea type="text" name="description" autocomplete="off"
                      class="layui-textarea">[[${config.description}]]</textarea>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="hidden" name="id" th:value="${config.id}" autocomplete="off" class="layui-input">
        <button class="layui-btn" lay-submit lay-filter="LAY-config-add-submit" id="LAY-config-add-submit">提交</button>
    </div>
</div>

<script th:src="@{/statics/layui/layui.js}"></script>
<script>
    layui.config({
        base: '/statics/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form'], function () {
        var $ = layui.$
            , form = layui.form;
    })
</script>
</body>
</html>